<!doctype HTML>
<html class="reftest-wait">
<meta charset="utf8">
<title>Content Visibility: scrollIntoView prevented</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
<link rel="match" href="spacer-and-container-scrolled-ref.html">
<meta name="assert" content="scrollIntoView is not prevented when the target is hidden">

<script src="/common/reftest-wait.js"></script>

<style>
.spacer {
  width: 150px;
  height: 3000px;
  background: lightblue;
}
#container {
  width: 150px;
  height: 150px;
  background: lightgreen;
  content-visibility: hidden;
}
#target {
  width: 100px;
  height: 100px;
  background: green;
}
</style>

<div class="spacer"></div>
<div id="container"><div id="target"></div></div>

<script>
function runTest() {
  document.getElementById("target").scrollIntoView();
  requestAnimationFrame(takeScreenshot);
}

window.onload = () => { requestAnimationFrame(runTest); };
</script>
</html>
